import 'dart:math';

import 'package:flutter/cupertino.dart';

/// FileName safe_padding
///
/// @Author lax
/// @Date 2025/3/7
///
/// @Description

class SafePadding extends StatelessWidget {
  static const double defaultMinBottom = 0;

  final double? minBottom;

  final EdgeInsets? padding;

  final Widget? child;

  const SafePadding({
    super.key,
    this.minBottom,
    this.padding = const EdgeInsets.all(0),
    this.child,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.only(
          bottom: max(minBottom ?? defaultMinBottom, MediaQuery
              .paddingOf(context)
              .bottom)),
      padding: padding,
      child: child,
    );
  }
}
